<?php
error_reporting(E_WARNING);
include_once '../includes/metodos.php';
connectSql();

function edit($id){
	$cliente = $_POST['cliente'];
	$tel = $_POST['tel'];
	$cel = $_POST['cel'];
	echo $cliente;
	$query = mysql_query("UPDATE tb_agenda SET nm_cliente='$cliente', telefone='$tel', celular='$cel' WHERE id=".$_POST['id']);
	if($query){
		echo '<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">location.href="index.php";</SCRIPT>';
	}
}

function encaixe_edit($id){
	$cliente = $_POST['cliente'];
	$tel = $_POST['tel'];
	$cel = $_POST['cel'];
	echo $cliente;
	$query = mysql_query("UPDATE tb_encaixe SET nm_cliente='$cliente', telefone='$tel', celular='$cel' WHERE id=".$_POST['id']);
	if($query){
		echo '<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">location.href="index.php";</SCRIPT>';
	}
}